TEMPLATE = app
CONFIG += c++11
CONFIG -= app_bundle
CONFIG -= qt

CONFIG += c++17

DESTDIR = $$PWD/../bin

RC_ICONS = logo.ico

win32{
    INCLUDEPATH += $$PWD/../Interlocker4/thirdparty/includes/wxwidgets \
                   $$PWD/../Interlocker4/thirdparty/includes/wxwidgets/msvc \
                   $$PWD/../Interlocker4/thirdparty/includes/libtcmalloc \
                   $$PWD/../Interlocker4/thirdparty/includes/crashrpt

    CONFIG(release,debug|release){
        QMAKE_LFLAGS_RELEASE += /OPT:NOICF
        QMAKE_CXXFLAGS_RELEASE -= -Ob2          # 移除默认的内联优化
        QMAKE_CXXFLAGS_RELEASE += -Ob1          # 禁用内联扩展

        LIBS += -L$$PWD/../Interlocker4/thirdparty/libs/wxwidgets \
                -lwxmsw32u_aui -lwxmsw32u_html -lwxmsw32u_core -lwxbase32u_xml -lwxbase32u \
                -lwxtiff -lwxjpeg -lwxpng -lwxzlib -lwxregexu -lwxexpat \
                -L$$PWD/../Interlocker4/thirdparty/libs/libtcmalloc -llibtcmalloc_minimal \
                -L$$PWD/../Interlocker4/thirdparty/libs/crashrpt -lCrashRpt1403 \
    }else{
        LIBS += -L$$PWD/../Interlocker4/thirdparty/libs/wxwidgets \
                -lwxmsw32ud_aui -lwxmsw32ud_html -lwxmsw32ud_core -lwxbase32ud_xml -lwxbase32ud \
                -lwxtiffd -lwxjpegd -lwxpngd -lwxzlibd -lwxregexud -lwxexpatd \
                -L$$PWD/../Interlocker4/thirdparty/libs/libtcmalloc -llibtcmalloc_minimal \
                -L$$PWD/../Interlocker4/thirdparty/libs/crashrpt -lCrashRpt1403 \
    }
 }else{
    QMAKE_CXXFLAGS += $$system(wx-config --cxxflags)
#LIBS += $$system(wx-config --libs)

    # 发布版本优化
    QMAKE_CXXFLAGS += -O2 -DNDEBUG

    INCLUDEPATH += /usr/include/wx-3.2 \
                   /usr/lib/x86_64-linux-gnu/wx/include/gtk3-unicode-3.2 \
                   #/usr/local/freetype-2.13.2/include/freetype2 \
                   /usr/local/include/gperftools \
                   #/usr/local/include/efsw

    CONFIG(release,debug|release){
        LIBS += -L/usr/lib/x86_64-linux-gnu \
                    -lwx_gtk3u_aui-3.2 \
                    -lwx_gtk3u_html-3.2 \
                    -lwx_gtk3u_core-3.2 \
                    -lwx_gtk3u_gl-3.2 \
                    -lwx_gtk3u_stc-3.2 \
                    -lwx_gtk3u_richtext-3.2 \
                    -lwx_baseu_xml-3.2 \
                    -lwx_baseu-3.2 \
                    -lwx_baseu_net-3.2 \
                -L/usr/local/freetype-2.13.2/lib -lfreetype \
                -L/usr/local/lib -ltcmalloc_minimal -lefsw

    }else{
        LIBS += -L/usr/lib/x86_64-linux-gnu \
                    -lwx_gtk3u_aui-3.2 \
                    -lwx_gtk3u_html-3.2 \
                    -lwx_gtk3u_core-3.2 \
                    -lwx_gtk3u_stc-3.2 \
                    -lwx_baseu_xml-3.2 \
                    -lwx_baseu-3.2 \
                -L/usr/local/freetype-2.13.2/lib -lfreetype \
                -L/usr/local/lib -ltcmalloc_minimal -lefsw
    }
 }

SOURCES += \
    NedAllocatedObject.cpp \
    NedAllocatorImpl.cpp \
    cjson.cpp \
    cmainframe.cpp \
    common.cpp \
    dropdownlistpanel.cpp \
    fastlz.cpp \
    log4z.cpp \
    luabridge/lua-5.4.7/fpconv.c \
    luabridge/lua-5.4.7/lapi.c \
    luabridge/lua-5.4.7/lauxlib.c \
    luabridge/lua-5.4.7/lbaselib.c \
    luabridge/lua-5.4.7/lbitlib.c \
    luabridge/lua-5.4.7/lcode.c \
    luabridge/lua-5.4.7/lcorolib.c \
    luabridge/lua-5.4.7/lctype.c \
    luabridge/lua-5.4.7/ldblib.c \
    luabridge/lua-5.4.7/ldebug.c \
    luabridge/lua-5.4.7/ldo.c \
    luabridge/lua-5.4.7/ldump.c \
    luabridge/lua-5.4.7/lfunc.c \
    luabridge/lua-5.4.7/lgc.c \
    luabridge/lua-5.4.7/linit.c \
    luabridge/lua-5.4.7/liolib.c \
    luabridge/lua-5.4.7/llex.c \
    luabridge/lua-5.4.7/lmathlib.c \
    luabridge/lua-5.4.7/lmem.c \
    luabridge/lua-5.4.7/loadlib.c \
    luabridge/lua-5.4.7/lobject.c \
    luabridge/lua-5.4.7/lopcodes.c \
    luabridge/lua-5.4.7/loslib.c \
    luabridge/lua-5.4.7/lparser.c \
    luabridge/lua-5.4.7/lstate.c \
    luabridge/lua-5.4.7/lstring.c \
    luabridge/lua-5.4.7/lstrlib.c \
    luabridge/lua-5.4.7/ltable.c \
    luabridge/lua-5.4.7/ltablib.c \
    luabridge/lua-5.4.7/ltests.c \
    luabridge/lua-5.4.7/ltm.c \
 #   luabridge/lua-5.4.7/lua.c \
    luabridge/lua-5.4.7/lua_cjson.c \
 #   luabridge/lua-5.4.7/luac.c \
    luabridge/lua-5.4.7/lundump.c \
    luabridge/lua-5.4.7/lutf8lib.c \
    luabridge/lua-5.4.7/lvm.c \
    luabridge/lua-5.4.7/lzio.c \
 #   luabridge/lua-5.4.7/onelua.c \
    luabridge/lua-5.4.7/strbuf.c \
    main.cpp \
    md5.cpp \
    networkframemanager.cpp \
    nodemanager/crouteconditions.cpp \
    nodemanager/wbasenode.cpp \
    nodemanager/wmountnode.cpp \
    nodemanager/wnodemanager.cpp \
    nodemanager/wsignallampnode.cpp \
    nodemanager/wswitchnode.cpp \
    nodemanager/wxpolygonex.cpp \
    scripteditor.cpp \
    scriptmanager.cpp \
    serversettingsdialog.cpp \
    wsignalserver.cpp

HEADERS += \
    NedAllocatedObject.h \
    NedAllocatorImpl.h \
    cjson.h \
    cmainframe.h \
    common.h \
    dropdownlistpanel.h \
    fastlz.h \
    log4z.h \
    luabridge/Array.h \
    luabridge/Dump.h \
    luabridge/List.h \
    luabridge/LuaBridge.h \
    luabridge/Map.h \
    luabridge/Optional.h \
    luabridge/Pair.h \
    luabridge/RefCountedObject.h \
    luabridge/RefCountedPtr.h \
    luabridge/Set.h \
    luabridge/UnorderedMap.h \
    luabridge/Vector.h \
    luabridge/detail/CFunctions.h \
    luabridge/detail/ClassInfo.h \
    luabridge/detail/Config.h \
    luabridge/detail/Constructor.h \
    luabridge/detail/Enum.h \
    luabridge/detail/Errors.h \
    luabridge/detail/Expected.h \
    luabridge/detail/FlagSet.h \
    luabridge/detail/FuncTraits.h \
    luabridge/detail/Globals.h \
    luabridge/detail/Invoke.h \
    luabridge/detail/Iterator.h \
    luabridge/detail/LuaException.h \
    luabridge/detail/LuaHelpers.h \
    luabridge/detail/LuaRef.h \
    luabridge/detail/Namespace.h \
    luabridge/detail/Options.h \
    luabridge/detail/Overload.h \
    luabridge/detail/Result.h \
    luabridge/detail/ScopeGuard.h \
    luabridge/detail/Security.h \
    luabridge/detail/Stack.h \
    luabridge/detail/TypeList.h \
    luabridge/detail/TypeTraits.h \
    luabridge/detail/Userdata.h \
    luabridge/detail/dump.h \
    luabridge/lua-5.4.7/fpconv.h \
    luabridge/lua-5.4.7/lapi.h \
    luabridge/lua-5.4.7/lauxlib.h \
    luabridge/lua-5.4.7/lcode.h \
    luabridge/lua-5.4.7/lctype.h \
    luabridge/lua-5.4.7/ldebug.h \
    luabridge/lua-5.4.7/ldo.h \
    luabridge/lua-5.4.7/lfunc.h \
    luabridge/lua-5.4.7/lgc.h \
    luabridge/lua-5.4.7/ljumptab.h \
    luabridge/lua-5.4.7/llex.h \
    luabridge/lua-5.4.7/llimits.h \
    luabridge/lua-5.4.7/lmem.h \
    luabridge/lua-5.4.7/lobject.h \
    luabridge/lua-5.4.7/lopcodes.h \
    luabridge/lua-5.4.7/lopnames.h \
    luabridge/lua-5.4.7/lparser.h \
    luabridge/lua-5.4.7/lprefix.h \
    luabridge/lua-5.4.7/lstate.h \
    luabridge/lua-5.4.7/lstring.h \
    luabridge/lua-5.4.7/ltable.h \
    luabridge/lua-5.4.7/ltests.h \
    luabridge/lua-5.4.7/ltm.h \
    luabridge/lua-5.4.7/lua.h \
    luabridge/lua-5.4.7/lua.hpp \
    luabridge/lua-5.4.7/luaconf.h \
    luabridge/lua-5.4.7/lualib.h \
    luabridge/lua-5.4.7/lundump.h \
    luabridge/lua-5.4.7/lvm.h \
    luabridge/lua-5.4.7/lzio.h \
    luabridge/lua-5.4.7/strbuf.h \
    md5.h \
    networkframemanager.h \
    nodemanager/crouteconditions.h \
    nodemanager/signal.hpp \
    nodemanager/wbasenode.h \
    nodemanager/wmountnode.h \
    nodemanager/wnodemanager.h \
    nodemanager/wsignallampnode.h \
    nodemanager/wswitchnode.h \
    nodemanager/wxpolygonex.h \
    scripteditor.h \
    scriptmanager.h \
    serversettingsdialog.h \
    signal.hpp \
    singleton.h \
    wsignalserver.h

DISTFILES += \
    resources/logo.xpm
